<template>
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container-fluid">
      <router-link class="navbar-brand" to="/page1">
        电影管理系统
      </router-link>

      <button
        class="navbar-toggler"
        type="button"
        data-bs-toggle="collapse"
        data-bs-target="#navbarNav"
        aria-controls="navbarNav"
        aria-expanded="false"
        aria-label="Toggle navigation"
      >
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav">
          <li class="nav-item">
            <router-link class="nav-link" to="/page1">
              首页
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/index">
              搜索
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/Addtype">
              插入类型
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/DeleteMovie">
              删除电影
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/UpdateMovieName">
              更新电影名
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/RankMovie">
              通过排名获取电影
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/Score">
              根据分数查询电影
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/Scorebig">
              查询分数大于指定值的电影
            </router-link>
          </li>
          <li class="nav-item">
            <router-link class="nav-link" to="/InsertMovie">
              插入电影
            </router-link>
          </li>
        </ul>
      </div>
    </div>
  </nav>
</template>

<script>
export default {
  name: 'NavBar'
}
</script>

<style scoped>
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  animation: slideDown 0.5s ease-in-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
  color: #007bff;
  transition: color 0.3s ease;
}

.navbar-brand:hover {
  color: #0056b3;
}

.nav-link {
  font-size: 1.1rem;
  color: #333;
  margin: 0 10px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

.nav-item.active .nav-link {
  color: #007bff;
  font-weight: bold;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #007bff;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

.navbar-toggler {
  border: none;
  outline: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

@media (max-width: 992px) {
  .navbar-nav {
    margin-top: 1rem;
  }

  .nav-link {
    margin: 0.5rem 0;
  }
}
</style>